<?php   // $Id: head.php 296 2008-10-12 10:36:05Z pcoustillas $ ?>
<?php   
//echo "PATH = " . get_include_path();

require_once("include/verif.php");
require_once("include/utils.php");
require_once("include/config/common.php");
//echo $lang;
require_once("language/$lang.php");
$conf_xml=simplexml_load_file('include/config.xml');
$generique=new generique;

	
class head_parent extends generique
{

    function metier_menu1() {
		if ($this->perm("user_dev") != 'n') 
		{
		?>
			<p id="menu1" class="menu" onmouseover="MontrerMenu('ssmenu1');" onmouseout="CacherDelai();">
			<a href="#" onfocus="MontrerMenu('ssmenu1');"><img border ="0" src="image/devis.png" alt="devis" /><br/>
				<?php aff_lang("lang_devis_pluriel"); ?> &nbsp;&nbsp;<span>&nbsp;:</span></a>
			</p>
			<ul id="ssmenu1" class="ssmenu" onmouseover="AnnulerCacher();" onmouseout="CacherDelai();">
				<li><a href="devis_lister.php"><?php aff_lang("Lister / Créer") ?><span>.</span></a></li>
			</ul>
		<?php
		}
    }
	
    function metier_menu2() {
		if ($this->perm("user_com") != 'n')
		{
		?>
			<p id="menu2" class="menu" onmouseover="MontrerMenu('ssmenu2');" onmouseout="CacherDelai();">
			<a href="bon_lister.php" onfocus="MontrerMenu('ssmenu2');"><img border ="0" src="image/commandes.png" alt="Commande" /><br/>
				<?php aff_lang("lang_commandes") ?><span>&nbsp;:</span></a>
			</p>
			<ul id="ssmenu2" class="ssmenu" onmouseover="AnnulerCacher();" onmouseout="CacherDelai();">
				<li><a href="bon_lister.php"><?php aff_lang("Lister / Créer") ?><span>&nbsp;;</span></a></li>
			</ul>
		<?php
		}
    }

	function metier_menu3 () {
		if ($this->perm("user_fact") != 'n')
		{
		?>
	
			<p id="menu3" class="menu" onmouseover="MontrerMenu('ssmenu3');" onmouseout="CacherDelai();">
			<a href="#" onfocus="MontrerMenu('ssmenu3');"><img border ="0" src="image/facture.png" alt="facture" /><br/>
					<?php aff_lang("lang_factures"); ?> &nbsp; <span>&nbsp;:</span></a>
			</p>
			<ul id="ssmenu3" class="ssmenu"	onmouseover="AnnulerCacher();" onmouseout="CacherDelai();">
				<li><a href="fact_creer.php"><?php aff_lang("lang_creer")?><span>&nbsp;;</span></a></li>
				<li><a href="fact_lister.php"><?php aff_lang("lang_lister")?><span>.</span></a></li>
				<li><a href="fact_multi_facture.php"><?php aff_lang("lang_fact_multi") ?><span>&nbsp;;</span></a></li>
				<li><a href="fact_imp_multiple.php"><?php aff_lang("lang_imp_multi") ?><span>&nbsp;;</span></a></li>
			</ul>
	
		<?php
		}
	}

	function metier_menu4 () {
	if ($this->perm("user_dep") != 'n' || $this->perm("user_stat") != 'n') 
		{
		?>
			<p id="menu4" class="menu" onmouseover="MontrerMenu('ssmenu4');" onmouseout="CacherDelai();">
				<a href="dep_lister.php" onfocus="MontrerMenu('ssmenu4');"><img border ="0" src="image/depense.png" alt="depense" /><br/>
				<?php aff_lang("lang_depenses")  ?> &nbsp; <span>&nbsp;:</span></a>
			</p>
			<ul id="ssmenu4" class="ssmenu"	onmouseover="AnnulerCacher();" onmouseout="CacherDelai();">
			<?php 
				if ($this->perm("user_dep") != 'n') {   ?>
					<li><a href="dep_lister.php"><?php aff_lang("Lister / Créer / Stats") ?><span>&nbsp;;</span></a></li>
				<?php } ?>
			</ul>

		<?php
		}
	}

    function metier_menu5() {
		if ($this->perm("user_art") != 'n')
		{

		?>
			<p id="menu5" class="menu" onmouseover="MontrerMenu('ssmenu5');" onmouseout="CacherDelai();">
				<a href="article_lister.php" onfocus="MontrerMenu('ssmenu5');"><img border ="0" src="image/article.png" alt="article" /><br/>
				<?php aff_lang("lang_articles"); ?> &nbsp; <span>&nbsp;:</span></a>
			</p>
			<ul id="ssmenu5" class="ssmenu" onmouseover="AnnulerCacher();" onmouseout="CacherDelai();">
				<li><a href="article_lister.php"><?php aff_lang("Lister / Créer") ?><span>&nbsp;;</span></a></li>
			</ul>
		<?php
		}
	}


	function metier_menu6() {
	if ($this->perm("user_cli") != 'n')
		{
		?>
	
			<p id="menu6" class="menu" onmouseover="MontrerMenu('ssmenu6');" onmouseout="CacherDelai();">
				<a href="client_lister.php" onfocus="MontrerMenu('ssmenu6');"><img border ="0" src="image/kontact_contacts.png" alt="clients" /><br/>
				<?php aff_lang("lang_clients")  ?> &nbsp; &nbsp; <span>&nbsp;:</span></a>
			</p>
			<ul id="ssmenu6" class="ssmenu" onmouseover="AnnulerCacher();" onmouseout="CacherDelai();">
				<li><a href="client_lister.php"><?php aff_lang("Lister / Créer") ?><span>&nbsp;;</span></a></li>
			</ul>
		
		<?php
		}
	}


	function metier_menu7 () 
	{
		if ($this->perm("user_stat") != 'n') 
		{
		?>
			<p id="menu7" class="menu" onmouseover="MontrerMenu('ssmenu7');" onmouseout="CacherDelai();">
			<a href="stat_toutes.php" onfocus="MontrerMenu('ssmenu7');"><img border ="0" src="image/stat.png" alt="stats" /><br/>
				<?php aff_lang("lang_statistiques")  ?> <span>&nbsp;:</span></a>
			</p>
			<ul id="ssmenu7" class="ssmenu"	onmouseover="AnnulerCacher();" onmouseout="CacherDelai();" >
				<li><a href="stat_toutes.php"><?php aff_lang("Toutes les stats") ?> <span>&nbsp;;</span></a></li>
			</ul>
		<?php
		}
	}


	function metier_menu8 ()
	{
		if ($this->perm("user_admin") == 'y')
		{
		?>
			<p id="menu8" class="menu" onmouseover="MontrerMenu('ssmenu8');" onmouseout="CacherDelai();">
				<a href="#" onfocus="MontrerMenu('ssmenu8');"><img border ="0" src="image/outil.png" alt="outils" /><br/>
				<?php   aff_lang("lang_outils")  ?> &nbsp; &nbsp; <span>&nbsp;:</span></a>
			</p>
			<ul id="ssmenu8" class="ssmenu"	onmouseover="AnnulerCacher();" onmouseout="CacherDelai();" >
				<li><a href="coordonnees_soc.php"><?php   aff_lang("Vos coordonnées") ?><span>&nbsp;;</span></a></li>
				<li><a href="admin_xml.php"><?php   aff_lang("Configuration") ?><span>&nbsp;;</span></a></li>
				<li><a href="update.php"><?php   aff_lang("lang_update") ?><span>&nbsp;;</span></a></li>
				<li><a href="backup_accueil.php"><?php   aff_lang("lang_back_men") ?><span>&nbsp;;</span></a></li>
				<li><a href="users_edit.php?action=new"><?php   aff_lang("lang_aj_utl") ?><span>&nbsp;;</span></a></li>
				<li><a href="users_lister.php"><?php   aff_lang("lang_list_utl") ?><span>&nbsp;;</span></a></li>
				<li><a href="include/calculette.html" onclick="window.open('','popup','width=300,height=220,top=200,left=150,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0')" target="popup"><?php   aff_lang("lang_calculette")  ?><span>&nbsp;;</span></a></li>
				<li><a href="logout.php"><?php   aff_lang("lang_sortir") ?><span>&nbsp;;</span></a></li>
	
			</ul>
	
		<?php
		}
	}


	function metier_menu9 ()
	{
		if (option("lots->lot_actif")=="oui" && $this->perm("user_fact") != 'n' ) 
		{
		?>
			<p id="menu9" class="menu" onmouseover="MontrerMenu('ssmenu9');" onmouseout="CacherDelai();">
			<a href="#" onfocus="MontrerMenu('ssmenu9');"><img border ='0' src='image/lot.png' alt='facture' /><br/>
				<?php aff_lang("lang_lots") ?> &nbsp; <span>&nbsp;:</span></a>
			</p>
			<ul id="ssmenu9" class="ssmenu" onmouseover="AnnulerCacher();" onmouseout="CacherDelai();">
				<li><a href="lister_lot.php"><?php   aff_lang("lang_Lister_lots") ?><span>&nbsp;;</span></a></li>
				<li><a href="form_lot.php"><?php   aff_lang("lang_cr_lot") ?><span>.</span></a></li>
				<li><a href="form_recherche_lot.php"><?php   aff_lang("lang_rech") ?><span>.</span></a></li>
			</ul>
	  
		<?php
		}
	}
	
} // fin de class

if (option("generale->metier") == "defaut")
{
	//Class basename(__FILE__,".php") extends head_parent {}
	Class head extends head_parent {}
} else {
	include ("metiers/" . option("generale->metier") . "/" . basename(__FILE__));
}
$metier=new head;



?> 

	<div id="conteneurmenu">
	
	<script language="Javascript" type="text/javascript">
		//preChargement();
		//on ne l'affiche pas le temps de le créer.
		document.getElementById("conteneurmenu").style.visibility="hidden";
	</script>

	<?php  
	//	metier_menu1();
	
	$metier->metier_menu1();
	$metier->metier_menu2();
	$metier->metier_menu3();
	$metier->metier_menu4();
	$metier->metier_menu5();
	$metier->metier_menu6();
	$metier->metier_menu7();
	$metier->metier_menu8();
	$metier->metier_menu9();

?>


</div>
<script language="javascript" src="javascripts/menu.js" type="text/javascript"></script>
	<div id="texte"></div>

<?php
/////////////////////////Fin du menu par default


// require ("include/del_pdf.php"); //plus necessaire car plus de pdf ne doit etre crée
$filename = 'installeur';

if (file_exists($filename)) {
	echo "<center><h1>$lang_erreur_insta</h1></center><br/>";
}
if (file_exists('dump/backup.sql')) {
	//echo "<center><h1>$lang_erreur_backup</h1></center><br/>";
}


?>

<center>

<?php
if ($conf_xml->generale->afficher_date=="oui")
{
	setlocale (LC_TIME,'fr_FR.utf8','fr_FR.UTF-8','fr_FR','fr_FR@euro');
	echo strftime("%A %d %B %Y");
}
?>
</center>
<script type="text/javascript">
		centrer_menu = true;
		Chargement();
</script>

